/*******************************************************************************
 * Copyright (c) 2009 David Harrison.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl-3.0.html 
 *  
 * Contributors:
 *     David Harrison - initial API and implementation
 ******************************************************************************/
package com.sfs.postcodes.beans;

import java.io.Serializable;

/**
 * The Class GeocodeBean.
 * 
 * @author David Harrison
 */

public class GeocodeBean extends Object implements Serializable {

    /** The unique serial id for the class. */
	private static final long serialVersionUID = -2442965899004898852L;
	
	/** The longitude. */
	private String longitude;
	
    /** The latitude. */
    private String latitude;
    
    
    /**
     * Sets the longitude.
     * 
     * @param longitude the new longitude
     */
    public void setLongitude(final String longitude) {
        this.longitude = longitude;
    }
    
    /**
     * Gets the longitude.
     * 
     * @return the longitude
     */
    public String getLongitude() {
        return this.longitude;
    }
    
    /**
     * Sets the latitude.
     * 
     * @param latitude the new latitude
     */
    public void setLatitude(final String latitude) {
        this.latitude = latitude;
    }
    
    /**
     * Gets the latitude.
     * 
     * @return the latitude
     */
    public String getLatitude() {
        return this.latitude;
    }
    
    /**
     * Gets the coordinates.
     * 
     * @return the coordinates
     */
    public String getCoordinates() {
        String coordinates = "";
        if(latitude!=null && longitude!=null) {
            coordinates = "(" + latitude + "," + longitude + ")";
        }
        return coordinates;
    }
    
    /**
     * Overrides the default toString method to return a string of the form:
     * "Lat: XX, Lon: YY"
     */
    @Override
    public String toString() {
        return "Lat: " + latitude + ", Lon: " + longitude;
    }
}
